package gui.newgui.archerdbeditor;

import gui.newgui.KeyListenerTypeSearch;

import java.awt.event.KeyEvent;

import javax.swing.JTable;

public class NewArcherDbEditorKeyListener extends KeyListenerTypeSearch {
	NewArcherDBEditor window;

	public NewArcherDbEditorKeyListener(NewArcherDBEditor newArcherDBEditor) {
		this.window = newArcherDBEditor;
	}

	@Override
	public void keyReleased(KeyEvent e) {
		if (e.getSource() instanceof JTable) {
			super.keyReleased(e);
			((NewArcherDBEditorController) this.window.getController()).filloutForm();
		} else if (e.getSource() == this.window.getMakeEditableCheckBox()) {
			((NewArcherDBEditorController) this.window.getController()).makeDropDownsEditable(!this.window.getMakeEditableCheckBox().isSelected());
		}

	}
}
